﻿using Microsoft.Win32;

namespace unTroublemakerUI.ViewModel
{
    public class SpecificationBrowser : ISpecificationBrowser
    {
        public string Path { get; set; }

        public bool BrowseSpecification()
        {
            var dialog = new OpenFileDialog
                {
                    Filter = "Specification XML files (*.xml)|*.xml|Any file (*.*)|*.*",
                    FileName = Path
                };

            if (dialog.ShowDialog() != true)
                return false;

            Path = dialog.FileName;
            return true;
        }
    }
}